package com.selfdiscipline.data.local.entity

import androidx.room.Entity
import androidx.room.PrimaryKey
import java.time.LocalDate
import java.time.LocalDateTime

/**
 * 习惯实体类
 */
@Entity(tableName = "habits")
data class HabitEntity(
    @PrimaryKey(autoGenerate = true)
    val id: Long = 0,
    
    // 基本信息
    val title: String,
    val description: String = "",
    
    // 习惯频率设置
    val frequency: String, // "daily", "weekly", "custom"
    val targetDays: Int? = null, // 目标天数（针对weekly和custom）
    
    // 提醒设置
    val reminderTime: LocalDateTime? = null,
    val reminderEnabled: Boolean = false,
    
    // 习惯状态
    val isActive: Boolean = true,
    val lastCompletedDate: LocalDate? = null,
    val streak: Int? = null, // 当前连续完成次数
    val completionCount: Int = 0, // 总完成次数
    val completionRate: Float? = null, // 完成率
    
    // 时间信息
    val createdAt: LocalDateTime? = LocalDateTime.now(),
    val updatedAt: LocalDateTime? = LocalDateTime.now()
) 